#include "createtask.h"
#include "ui_createtask.h"
#include "ui_taskpage.h"
#include "databasemanager.h"
#include "taskpage.h"
#include <QDate>

extern TaskPage *task;

CreateTask::CreateTask(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::CreateTask)
{
    ui->setupUi(this);
}

CreateTask::~CreateTask()
{
    delete ui;
}


void CreateTask::on_pushButton_clicked()
{
    QString f1=ui->lineEdit->text();
    QString f3=ui->dateEdit->text();
    qDebug()<<"createtask:  f3:"<<f3;

    DatabaseManager::insert_task(f1,f3);

    emit itemDataChanged();
    this->close();
}//创建成功关闭

void CreateTask::on_pushButton_2_clicked()
{
    this->close();
}//未创建关闭

